﻿namespace BuildStatusIndicator.Controller.TfsConnectionStatergy
{
    public class ConnectionStrategyFactory
    {
        private ConnectionStrategyFactory()
        {
        }

        public static IConnectinonStratergy Create(string serverUrl, string teamProject, uint pollingIntervall,
                                                      string username, string password)
        {
            if (string.IsNullOrEmpty(username))
                return new WindowsAuthenticationConnectinonStratergy(serverUrl, teamProject, pollingIntervall);
            else
                return new UsernameConnectinonStratergy(serverUrl, teamProject, pollingIntervall, username,
                                                                  password);
        }
    }
}